<?php
namespace Admin\Controller;
use Common\Controller\CommonController;
class AuthenticationController extends CommonController {
    public function index(){
    	$model = M("user");
		if(isset($_GET["status"])) {
			if($_GET["status"] == 1) {
				$where = "status=1";
				$this->assign("status",1);
			}else {
				$where = "status=0";
				$this->assign("status",0);
			}
		}else {
			$where = "status=0";
			$this->assign("status",0);
		}
    	$data = $model->where($where)->order("id")->select();
		$this->assign("total",count($data));
		$this->assign("data",$data);
        $this->display();
    }
    public function authentication($id) {
        $model = M("user");
        $model->status = 1;
        $model->where("id = $id")->save();
        $this->redirect("Authentication/index");
    }
}